package org.szpshang.system.resource.service.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.szpshang.framework.support.dao.hibernate.impl.BaseDao;
import org.szpshang.system.resource.service.ResourceService;

@Service("resourceService")
public class ResourceServiceImpl implements ResourceService {

	protected Log logger = LogFactory.getLog(this.getClass());

	@Autowired
	protected BaseDao baseDao;
	
	@Override
	public List<?> getRootResource() {
		return baseDao.findByHQL(" from  SysFunction t where t.parent is null order by ORDERNO");
	}
	
	@Override
	public List<?> getRootResource(String id) {
		return baseDao.findByHQL(" from  SysFunction t where  t.parent like '"+id+"%' order by FUNCTIONID ,ORDERNO");
	}
	
}
